//
//  AddTagCell.m
//  timelyRain
//
//  Created by Jiafei Wei on 16/9/29.
//  Copyright © 2016年 Jiafei Wei. All rights reserved.
//

#import "AddTagCell.h"
@interface AddTagCell()
@property (weak, nonatomic) IBOutlet UIImageView *log;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UIImageView *status;
- (IBAction)click:(id)sender;

@end
@implementation AddTagCell

+ (instancetype)setAddTagCellWithTableView:(UITableView *)tableView
{
    static NSString *reuseId = @"AddTagCell";
    AddTagCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:@"AddTagCell" owner:nil options:nil] lastObject];
    }
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
- (IBAction)click:(id)sender {
    if(_delegate && _indexPath && [_delegate respondsToSelector:@selector(clickItem:)])
    {
        [_delegate clickItem:self.indexPath];
    }
}
-(void)setData:(AddTagDao *)data{
    _data =data;
    _name.text=_data.text;
    [_log setImage:[UIImage imageNamed:_data.imageName]];
    if (_data.selcect){
        [_status setImage:[UIImage imageNamed:@"点击单选状态"]];
    }
}
@end
